//
// Created by Administrator on 2021/7/10.
//

#include <iostream>
#include <vector>

// const iter 和 const_iter
int main() {
    std::vector<int> vec;
    for (int i = 0; i < 10; ++i) {
        vec.push_back(i);
    }
    const std::vector<int>::iterator iter = vec.begin(); // 类似于 const int * iter (const data)
    *iter = 10; // ok
//    ++iter; // error
    std::vector<int>::const_iterator cIter = vec.begin(); // 类似于 int * const cIter (const pointer)
//    *cIter = 10; // error
    ++cIter; // ok


    return 0;
}